package com.ruoyi.kis.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult_KIS;
import com.ruoyi.kis.domain.ZxckF;
import com.ruoyi.kis.domain.ZxrkF;
import com.ruoyi.kis.service.IKisService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.SwaggerDefinition;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @Author: zhanglm
 * @CreateDate: 2025-03-04 14:59
 * @FullNameClass: com.ruoyi.kis.controller.KisZxController
 * @Description: 杂项出库入库
 *
 * WMS >> ERP
 *
 */

@RestController
@RequestMapping("/kiszx")
@Component("kiszx")
@Api("kis出库入库接口")
public class KisZxController extends BaseController {



    @Autowired
    private IKisService kisService;

    private static final Logger LOGGER = LoggerFactory.getLogger(KisZxController.class);


    @ApiOperation("杂项出库单")
    @RequestMapping("/ck")
    public AjaxResult_KIS ck(@RequestBody ZxckF zxckF){
        int count = kisService.saveZxckFeedBack(zxckF);
        LOGGER.info("杂项出库单反馈："+count);
//        return AjaxResult_KIS.success("success","");
        if (count == 0){
            return AjaxResult_KIS.error("error","");
        }else{
            return AjaxResult_KIS.success("success","");
        }
    }

    /**
     *
     * @param zxrkF
     * @return
     */
    @ApiOperation("杂项入库单")
    @RequestMapping("/rk")
    public AjaxResult_KIS ck(@RequestBody ZxrkF zxrkF){
        int count = kisService.saveZxrkFeedBack(zxrkF);
        LOGGER.info("杂项出库单反馈："+count);
        if (count == 0){
            return AjaxResult_KIS.error("error","");
        }else{
            return AjaxResult_KIS.success("success","");
        }
    }
}
